package com.jqk.apipassener.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

/**
 * @Author:jiangqikun
 * @Date:2022/3/11 18:59
 **/

@Component
public class Configuration {

    /**
     * 创建 RestTemplate 并使用 Ribbon 负载均衡
     */
    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return  new RestTemplate();
    }
}
